<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateDevicesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('devices', function(Blueprint $table)
		{
			$table->increments('id');
			$table->timestamps();

			//关联tyw_users中的id
			$table->integer('uid');
			//varchar 255 设备名称
			$table->string('name');
			//varchar 255 设备型号
			$table->string('model');
			//text 设备原理
			$table->text('theory');
			//varchar 255 生产商
			$table->string('creator');
			//double 设备价格最低价
			$table->double('minimize_price');
			//double 设备价格最高价
			$table->double('maximize_price');
			//text 认证信息
			$table->text('auth_info');
			//text 产品标准
			$table->text('standard');
			// 设备图片
			$table->string('image');
			//是否推荐到低碳产业项目首页
			$table->tinyInteger('is_rec_industry_index');
			//是否推荐到列表页底部
			$table->tinyInteger('is_rec_list_bottom');
			//推荐到右侧列表
			$table->tinyInteger("is_rec");
			//是否融资
			$table->tinyInteger('is_financing');
			// 设备简介
			$table->text('description');
			//添加 融资后的页面链接
			$table->text("finance_url");
			// 节能率
			$table->double("efficiency", 13,2);
			$table->timestamp('create_time');

			// 列表页排序
			$table->tinyInteger('order');
			// 产业首页排序
			$table->tinyInteger('industry_order');
			// 项目审核状态
			$table->tinyInteger("verify_state");
			//热门排序
			$table->tinyInteger("hot_state");

			$table->softDeletes();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('devices');
	}

}
